<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<span id="s1"></span>
<a href="first">超链接方式</a>
<form action="first">
    <button>表单方式</button>
</form>
<button onclick="funA()">JavaScript方式</button>
</body>
</html>
<script>
    let num = Math.floor(Math.random() * 100 + 1);

    function funA() {
        location.href = 'first';
    }

    window.onload = function () {
        document.getElementById('s1').innerText = num;
    }
</script>